/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * com_distri_articulos_almacen_resurtir.java
 *
 * Created on 2/02/2012, 01:31:05 PM
 */

package sie_invdis;

import java.sql.*;
import javax.swing.*;


import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.JTable.*;
import java.awt.*;
import java.awt.event.*;
import java.util.Date;
import java.util.Calendar;
import java.text.SimpleDateFormat;
import java.text.ParseException;
import java.text.*;
/**
 *
 * @author Michelle
 */
public class com_distri_articulos_almacen_resurtir extends javax.swing.JFrame {

     private javax.swing.table.DefaultTableModel jtable_modelo;
    
     private javax.swing.table.DefaultTableModel jtable_modelo_familiarexistencia;
     private javax.swing.table.DefaultTableModel jtable_modelo_almacen;

     private java.util.Date fechahoy=new Date();
     private String textohtml="";
     private int buscamp=1,indexactual=0,opbuscamp=1,controltiendas=0;
     bd_conexion x = new bd_conexion() ;
       //se creaa la variable resultset
     ResultSet rs = null;
    /** Creates new form com_distri_articulos_almacen_resurtir */
    public com_distri_articulos_almacen_resurtir() {
        this.iniciar_modelo_de_tabla();
        this.iniciar_modelo_familiaexistencias();
        this.iniciar_modelo_articulosasurtir();
        initComponents();
        this.carga_datos_existxfamilia();
        if (variables_global.getnivelusu()==3)
            {
                this.iniciar_modelo_tiendasexis(2);
            }
        else
            {
                this.iniciar_modelo_tiendasexis(1);
            }
        this.buttonGroup1.setSelected(jrb_bclave.getModel(), true);
        this.buttonGroup2.setSelected(jrb_obexacto.getModel(), true);
        this.jtf_busqueda.requestFocus();
         Calendar fechaini = Calendar.getInstance(); // obtiene la fecha actual
        fechaini.set(fechahoy.getYear()+1900,fechahoy.getMonth(), 1);

        this.jdc_fechadocto.setDate(fechahoy);

        this.jtb_almacensurtir.getColumnModel().getColumn(0).setPreferredWidth(10);//Folio
        this.jtb_almacensurtir.getColumnModel().getColumn(1).setPreferredWidth(10);//Folio
        this.jtb_almacensurtir.getColumnModel().getColumn(2).setPreferredWidth(60);//Folio
        this.jtb_almacensurtir.getColumnModel().getColumn(3).setPreferredWidth(120);//Folio
        this.jtb_almacensurtir.getColumnModel().getColumn(4).setPreferredWidth(20);//Folio
        this.jtb_almacensurtir.getColumnModel().getColumn(5).setPreferredWidth(20);//Folio
    }



private void iniciar_modelo_de_tabla()
    {
        jtable_modelo=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo.addColumn("Clave");
        jtable_modelo.addColumn("Descripcion.");
        jtable_modelo.addColumn("Control Alm.");
        jtable_modelo.addColumn("7:Almacen:21");
       //se crea intancia de la clase conexion

}
private void iniciar_modelo_familiaexistencias()
{
      jtable_modelo_familiarexistencia=new javax.swing.table.DefaultTableModel();//Creo el modelo
      jtable_modelo_familiarexistencia.addColumn("familia");
      jtable_modelo_familiarexistencia.addColumn("Piezas");
      jtable_modelo_familiarexistencia.addColumn("Precio");
}
private void iniciar_modelo_articulosasurtir()
{
      jtable_modelo_almacen=new javax.swing.table.DefaultTableModel();//Creo el modelo
      jtable_modelo_almacen.addColumn("Tienda");
      jtable_modelo_almacen.addColumn("Almacen");
      jtable_modelo_almacen.addColumn("Articulo");
      jtable_modelo_almacen.addColumn("Descripcion");
      jtable_modelo_almacen.addColumn("Cantidad");
      jtable_modelo_almacen.addColumn("Observ.");
}
private void iniciar_modelo_tiendasexis(int opcion)
    {
     switch (opcion)
        {
            case 1:
                 this.jcbx_clientesorigen.addItem("0:Elige Origen");
                 this.jcbx_clientesdestino.addItem("0:Elige Destino");
                try
                    {
                    rs = x.sieuno_executediversosv2("select * from x1distribucion_tiendas_activas() as (tie_descri character varying(35),tie_id integer,tie_desesque character varying(25),idclie character varying(12));",variables_global.getconexiongral());
                    while (rs.next())
                        {
                        this.jcbx_clientesorigen.addItem(rs.getString("idclie")+":"+rs.getString("tie_descri"));
                        this.jcbx_clientesdestino.addItem(rs.getString("idclie")+":"+rs.getString("tie_descri"));
                        if(rs.getInt("tie_id")!=7)
                            {
                                jtable_modelo.addColumn("<html><b>"+rs.getString("tie_id")+":"+rs.getString("tie_descri")+":"+rs.getString("idclie")+"</b></html>");
                            }
                        }
                    }
                    catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                    }
            break;
            case 2:
                  jtable_modelo.addColumn("<html><b>"+variables_global.getidtiendami()+":"+variables_global.getidtiendamidescribe()+":"+variables_global.getcliente_tistribucion()+"</b></html>");
            break;
        }
    controltiendas=1;
    }

private int findcolumna_idtienda (String titulo)  {
      int columnas = jtable_modelo.getColumnCount(),columencontrado=0;
      String columtitulo[]=null;
      for(int j = 2 ;j < columnas ; j++)
            {
                columtitulo= jtable_modelo.getColumnName(j).replace("<html><b>","").replace("</b></html>","").split(":");
                if(columtitulo[0].equals(titulo))
                    {
                            columencontrado=j;
                            j=columnas;
                    }
            }
    //System.out.println("Esto encontro:"+columencontrado);
    return columencontrado;
}
private void crea_hoja_agregaexistencias(String codigo,String existencia,int columna)
    {
        DecimalFormat miformat = new DecimalFormat("###,###,###");
        int numerofilas=this.jtable_modelo.getRowCount();
        String mesactual="";
        int numerocolumnas=this.jtable_modelo.getColumnCount(),ii=00;
        int encontrado=0;
        Object[] fnewRow = new Object[numerocolumnas];
        float abononumerico=0;
       //invoco al metodo que trae el recordset de datos
        abononumerico=Float.valueOf(existencia);
        for( ii=0;ii<numerofilas;ii++)
                {
                    mesactual=jtable_modelo.getValueAt(ii, 0).toString();
                    if (mesactual.equals(codigo))
                        {
                            encontrado=1;
                            jtable_modelo.setValueAt(miformat.format(abononumerico),ii ,columna);
                        }
                }
    }

private int findarticulo_requisicion (String codigo,String cliente)  {
     int numerofilas=this.jtable_modelo_almacen.getRowCount(),ii=00,encontrado=0;
      String columtitulo=null,mesactual="";
      System.out.println("Esto encontro:"+codigo);
       for( ii=0;ii<numerofilas;ii++)
                {
                    mesactual=jtable_modelo_almacen.getValueAt(ii, 2).toString();
                    columtitulo=jtable_modelo_almacen.getValueAt(ii, 0).toString();
                    if ((mesactual.equals(codigo)) && (columtitulo.equals(cliente)))
                        {
                            encontrado=1;
                        }
                }
    return encontrado;
}

private void carga_datos_existxfamilia()
    {
      DecimalFormat myForma = new DecimalFormat("###,###,###,###");
      //String texto="select * from x1distribucion_terminados_almacen_costosfamilias(1) as (idfam character varying(5),existencia numeric,importecosto numeric, importeprecio numeric,descri_familia character varying(40))";
      String texto="select * from x1sieuno_articulo_costosxfamiliayexis(1,'7','','') as (id integer,nombre text,piezas double precision,costo double precision,precio double precision)",familiatienda[]=null;
      try
        {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                familiatienda=rs.getString ("nombre").split(":");
                    jtable_modelo_familiarexistencia.addRow(new Object[]{rs.getString ("id")+":"+ familiatienda[2],myForma.format(rs.getFloat("piezas")),myForma.format(rs.getFloat("precio"))});
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
 private void carga_datos_catalogoarticulos_almacen(int rbbuscam,int rbopbuscam,String busqueda)
 {
     
     textohtml="<tr><th>Clave Articulo/Descripcion/foto</th><th>Clave Articulo/Descripcion/foto</th><th>Clave Articulo/Descripcion/foto</th><th>Clave Articulo/Descripcion/foto</th></tr>";

     int fila=0;
      while(jtable_modelo.getRowCount()>0)jtable_modelo.removeRow(0);
       String texto="select * from x1distribucion_terminados_articulos_almacen("+rbbuscam+","+rbopbuscam+",'"+busqueda+"') as (id character varying(16),codbarra character varying(16),idstatus smallint,statusdescribe text,describearticulo character varying(80),describcorta character varying(20),unsal character varying(3),unent character varying(3),facentruni numeric,uniempaque character varying(12),idtempo smallint,describetemp text,idfamilia character varying(5),familiadescribe character varying(40),controlalma character varying(20),stocminimo numeric,stocmaximo numeric,precio1 numeric,perecio2 numeric,precio3 numeric,precio4 numeric,precio5 numeric,ultimocosto numeric,costoprom numeric,pensurtir numeric,tiemposurtido smallint,acumprod numeric,acumimporte numeric,idtipoarticulo smallint,tipodescribe text,fechaprototipo date,fechaautoriza date,fechainiprod date,fechaultimaent date,usuario character varying(20),observacion character varying(255),idprovee character varying(12),descripprovee character varying(60),nombrecreador character varying(80),valor_x character varying(20),valorx_st character varying(20),idpersonal character varying(16),nombrepersonal character varying(80),idlinea smallint,describelinea text,existenciaf numeric,almacenlugar text,existencia double precision)";
       System.out.println(texto);
       try
        {
           rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                    //System.out.println(rs.getString("existencia"));
                    if (rs.getFloat("existencia")!=0)
                     {
                        jtable_modelo.addRow(new Object[]{rs.getString ("id"),rs.getString ("describearticulo"),rs.getString ("almacenlugar").replace(".","")+".",rs.getString ("existencia")});
                      if (fila<=0)
    					{
            					textohtml+= "<tr>";
        				}
					fila++;
                    textohtml+="<th>"+rs.getString ("id")+"<br>"+rs.getString ("describearticulo") + " $"+rs.getString("precio5")+" Exis="+rs.getString ("existencia") +"<br>"+"<img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+rs.getString ("id")+".JPG\" width=230 height=190 border=0 alt=\"Foto Articulo\" />"+"</th>";
                    if (fila>=4)
                        {
                            textohtml+= "</tr>";
                            fila=0;
                        }
                     }
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }

       //this.jepn_fotos.setText("<html><head></head><body><table>"+textohtml+"</table></body></html>");

 }
private void dioclickfamilia(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
       System.out.println("dio doble  click");
       int fila = jtb_almacen_familias.getSelectedRow();

       String idcadena[]=this.jtb_almacen_familias.getValueAt(fila, 0).toString().split(":");

       this.jtf_busqueda.setText(idcadena[0]);
       if(JOptionPane.showConfirmDialog(null, "Desea Ver los Articulos de Esta Familia?")==0)
            {
                opbuscamp=1;
                this.buttonGroup2.setSelected(jrb_obexacto.getModel(), true);
                buscamp=5;
                this.buttonGroup1.setSelected(jrb_bidfam.getModel(), true);
                this.carga_datos_catalogoarticulos_almacen(buscamp,opbuscamp,this.jtf_busqueda.getText().toUpperCase().trim());
            }
            else
                {
                    //this.jtf_busqueda.requestFocus();
                }
       this.verexistencias();
    }
private String fechaamericana(Date fe) {
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("yyyy-MM-dd");
       String cadenafecha="";
       cadenafecha= formateadorestaeuropa.format(fe);
       return cadenafecha;

    }
private void jtb_almacen_familiasMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
private void verexistencias()
        {
int numerofilas = this.jtable_modelo.getRowCount(),ii=0;
String selectin="";
        for( ii=0;ii<numerofilas;ii++)
                {
                if (ii>0)
                    {
                        selectin+=".";
                    }
                selectin+=""+jtable_modelo.getValueAt(ii ,0)+"";
                }

    System.out.println(selectin);

            String texto="select * from x1sieuno_articulo_detalle(1,"+variables_global.getidtiendami()+",'','"+selectin+"') as (ida integer,min integer,max integer,exi double precision,idp integer,cod text,cndt integer,descor text,preve double precision,pre_re real,clavepro text)";
            System.out.println(texto);
            String despartido[]=null;
            int columnatitulo=0;
            try
               {
               rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
               while (rs.next())
                    {
                            despartido=rs.getString("descor").split(":");
                            
                            columnatitulo=this.findcolumna_idtienda(despartido[0]);
                            System.out.println(rs.getString("descor")+"en columna:"+columnatitulo);
                            if ( columnatitulo>0)
                                {
                                    this.crea_hoja_agregaexistencias(rs.getString("clavepro"),rs.getString("exi"),columnatitulo);
                                }
                    }
                }
            catch(Exception e)
                {
                    System.out.println(e.getMessage());
                }
        }

private void dioclickalmacen(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         //System.out.println("dio doble  click");
         float pedido=0;
         int columna =jtb_almacen_catalogo.getSelectedColumn();
         String columtitulo[]= jtable_modelo.getColumnName(columna).replace("<html><b>","").replace("</b></html>","").split(":");
         int filaalmacenes = jtb_almacen_catalogo.getSelectedRow();
         String solicitocantidad="";
         if (this.findarticulo_requisicion(jtable_modelo.getValueAt(filaalmacenes, 0).toString().replace("<html><BODY bgcolor=#CC0066>", "").replace("</BODY></html>",""),columtitulo[2])==0)
            {
            if (columna>3)
               {
                    solicitocantidad=JOptionPane.showInputDialog("Cantidad a Surtir:");
                    //arreglo_cantidad=solicitocantidad.toString().split("*");
                try{
                      pedido = Float.valueOf(solicitocantidad).floatValue();
                   }catch (NumberFormatException nfe)
                   {
                       pedido=0;
                   }
                if (pedido>0)
                    {
                        jtable_modelo_almacen.addRow(new Object[]{columtitulo[2],"09",jtable_modelo.getValueAt(filaalmacenes, 0).toString().replace("<html><BODY bgcolor=#CC0066>", "").replace("</BODY></html>",""),columtitulo[1]+":"+jtable_modelo.getValueAt(filaalmacenes, 1).toString(),pedido,"."});
                        this.find_textoenjtable(0,0,jtable_modelo.getValueAt(filaalmacenes, 0).toString());
                    }
            }
         }
         else
             {
                 JOptionPane.showMessageDialog(null,"<html><h2>Articulo ya Solicitado:"+jtable_modelo.getValueAt(filaalmacenes, 0).toString().replace("<html><BODY bgcolor=#CC0066>", "").replace("</BODY></html>","")+"</h2></html>", "Sistema Integral(Requisiscion)",1);
             }
        //setVisible(false);
    }
private void find_textoenjtable(int columna,int filainicio,String texto)
    {

       int totalfilasreporte=this.jtable_modelo.getRowCount(),i=0,encontro=0,coincidencias=0;
       String cadenaobtenida="";
         //genero los totales por tienda
       for(i=0;i<totalfilasreporte;i++)
            {
                cadenaobtenida=jtable_modelo.getValueAt(i, columna).toString();
                encontro=cadenaobtenida.indexOf(texto);
                if(encontro!=-1)
                    {
                        System.out.println(cadenaobtenida+" en pocicion "+i);

                        jtable_modelo.setValueAt("<html><BODY bgcolor=#CC0066>"+cadenaobtenida+"</BODY></html>", i,columna);
                        encontro=-1;
                        coincidencias++;
                    }
            }
    }
 private void imprimir(int pag,float ptotal)
    {
            this.objimpresora=new com_distri_folios_imprimir();

     this.objimpresora.setOneItem_cadenas_a_imprimir("Surtir Mercancia");

     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     this.objimpresora.setOneItem_cadenas_a_imprimir("Responsable Almacen: ______________");
     this.objimpresora.setOneItem_cadenas_a_imprimir("Empaco: ______________");
     this.objimpresora.setOneItem_cadenas_a_imprimir("Recibio: ______________");
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     this.objimpresora.setObjeto_tabla(jtb_almacensurtir);
     this.objimpresora.imprimir_all(3,pag);
    }

 private void guarda_requisision()
    {
        ResultSet rs = null;
        float cantidad=0;
        int nobjetotabla=this.jtable_modelo_almacen.getRowCount();
        int fi=0,controlfolio=0;
        String cadenafilas="{'", arreglo_articulos[]=null;
        JPasswordField pwd = new JPasswordField(10);

        //lanso la confirmacion de password
        int action = JOptionPane.showConfirmDialog(null, pwd,"Contraseña:(Use Tab p/moverse o Mause)",JOptionPane.OK_CANCEL_OPTION);
        if(action < 0) {
            JOptionPane.showMessageDialog(null,"No se realiza Proceso, Gracias");
        } else {
            //comparo si la contraseña es apropiada
            if(variables_global.getPassword().equals(String.valueOf(pwd.getPassword()))) {//inicia trabajo para actualizar diferencias
                for(fi=0;fi<nobjetotabla;fi++)
                        {
                                try
                                    {
                                        cantidad = Float.valueOf(this.jtable_modelo_almacen.getValueAt(fi, 4).toString()).floatValue();
                                    }
                                catch (NumberFormatException nfe)
                                    {
                                        cantidad=0;
                                    }
                    // System.out.println("cachar error"+cadenafilas);
                            if (cantidad > 0)
                                    {
                                        cadenafilas+=""+this.jtable_modelo_almacen.getValueAt(fi, 4).toString()+":"+this.jtable_modelo_almacen.getValueAt(fi, 2).toString()+":"+this.jtable_modelo_almacen.getValueAt(fi, 2)+""+"\n";
                                    }
                        }//fin del for
                //System.out.println(s);
                //arreglo_articulos=cadenafilas.split(":");
                if(JOptionPane.showConfirmDialog(null, "Documento sera Guardado. Estan correcto sus Datos?")==0)
                    {
                        int numerofilas=this.jtable_modelo_almacen.getRowCount();
                        String punto="";
                        for(int i = 0 ;i < numerofilas; i++)
                            {
                                punto=jtable_modelo_almacen.getValueAt(i, 5).toString().replace(",", "");
                                jtable_modelo_almacen.setValueAt(punto+".", i,5);
                            }
                        java.util.Vector arreglodearticulos=this.jtable_modelo_almacen.getDataVector();
                        String articulos_papostgresql=arreglodearticulos.toString();
                        articulos_papostgresql=articulos_papostgresql.replace('[','{');
                        articulos_papostgresql=articulos_papostgresql.replace(']','}');
                        articulos_papostgresql=articulos_papostgresql.replace("null",".");
                        String texto="select * from x1distribucion_almacen_traspa_resurt("+variables_global.getId_empleado()+",'"+this.fechaamericana(this.jdc_fechadocto.getDate())+"','"+this.jtf_observaciones.getText().trim().toUpperCase()+"',1,'"+articulos_papostgresql+"')";
                        System.out.println(texto);
                            try {
                                rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                                while (rs.next())
                                        {
                                        controlfolio=rs.getInt(1);
                                        if (rs.getInt(1) > 0)
                                                {
                                                    while(jtable_modelo_almacen.getRowCount()>0)jtable_modelo_almacen.removeRow(0);
                                                    JOptionPane.showMessageDialog(null,"Requisicion Correcta, Gracias", "Sistema Integral(Requisicion Insumos) : Confirmacion",1);
                                                }
                                            else
                                                {
                                                    JOptionPane.showMessageDialog(null," Error Verifique sus Cantidades", "Sistema Integral(requisicion Insumos) : Error",1);
                                                }
                                        }
                                } catch(Exception e)
                                   {
                                        System.out.println(e.getMessage());
                                        JOptionPane.showMessageDialog(null," Recepcion Incorrecta ", "Sistema Integral(Requisicion Insumos) : Error",1);
                                   }
                }//fin del if qu confirmo guardar diferencia
            }
            else
                {
                    JOptionPane.showMessageDialog(null,"por Favor teclee su contraseña coreectamente, verifique mayusculas en teclado");
                }
        }
    }
 private void carga_datos_fotospaginacion(int pagina)
    {
        textohtml="";
        int nif=0,pag=pagina,nobjetotabla=this.jtable_modelo.getRowCount(),nip=0,ni=0,fila=0,artxpag=Integer.valueOf(this.jtf_fotosartxpag.getText());
        float totalpaginas=this.jtable_modelo.getRowCount()/artxpag;
        this.jlbl_paginas.setText("PAGINAS :"+totalpaginas);
             nif=((pag+1)*artxpag);
             nip=((pag)*artxpag);
                        if (nif < nobjetotabla )
                            {
                                nobjetotabla=nif;
                            }
  System.out.println("tOTAL FILAS:"+this.jtable_modelo.getRowCount()+" PAGINA ACTUAL "+pagina+" filainicial "+ nip + " Fila Final"+ nobjetotabla);
                    /*Impresion de los productos*/
                        for(ni=nip;ni<nobjetotabla;ni++)
                        {
                            System.out.println(" fila Actual "+ ni );
                                if (fila<=0)
                                    {
                                    	textohtml+= "<tr>";
                                    }
                                    fila++;
                                    textohtml+="<th>"+jtable_modelo.getValueAt(ni, 0).toString()+"<br>"+jtable_modelo.getValueAt(ni, 1).toString() + "<br>"+"<img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+jtable_modelo.getValueAt(ni, 0).toString()+".JPG\" width=230 height=190 border=0 alt=\"Foto Articulo\" />"+"</th>";
                                 if (fila>=4)
                                    {
                                        textohtml+= "</tr>";
                                        fila=0;
                                    }
                        }
         this.jepn_fotos.setText("<html><head></head><body><table>"+textohtml+"</table></body></html>");
         System.out.println(" este es html "+ textohtml );
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        buttonGroup2 = new javax.swing.ButtonGroup();
        jPanel5 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jtb_almacen_familias = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jPanel2 = new javax.swing.JPanel();
        jrb_bclave = new javax.swing.JRadioButton();
        jrb_bdescrip = new javax.swing.JRadioButton();
        jtf_busqueda = new javax.swing.JTextField();
        jbtn_buscar = new javax.swing.JButton();
        jrb_bitem = new javax.swing.JRadioButton();
        jrb_bprecio = new javax.swing.JRadioButton();
        jrb_obexacto = new javax.swing.JRadioButton();
        jrb_obcomienza = new javax.swing.JRadioButton();
        jrb_obaniway = new javax.swing.JRadioButton();
        jrb_bidfam = new javax.swing.JRadioButton();
        jrb_bidsubfam = new javax.swing.JRadioButton();
        jrb_bdessubfam = new javax.swing.JRadioButton();
        jrb_descripcorta = new javax.swing.JRadioButton();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jtb_almacen_catalogo = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jScrollPane2 = new javax.swing.JScrollPane();
        jep_imagen2 = new javax.swing.JEditorPane();
        jtf_articulo = new javax.swing.JTextField();
        jdc_fechadocto = new com.toedter.calendar.JDateChooser();
        jchbx_veridinsumo1 = new javax.swing.JCheckBox();
        jchbx_veridinsumo = new javax.swing.JCheckBox();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        jtb_almacensurtir = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                if (mColIndex < 2)
                return false;
                else
                return true;

            }
        }
        ;
        jbtn_guardar = new javax.swing.JButton();
        jtf_observaciones = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        jepn_fotos = new javax.swing.JEditorPane();
        jlbl_paginas = new javax.swing.JLabel();
        jbtn_anterior = new javax.swing.JButton();
        jtf_paginaactual = new javax.swing.JTextField();
        jbtn_siguiente = new javax.swing.JButton();
        jtf_fotosartxpag = new javax.swing.JTextField();
        jPanel6 = new javax.swing.JPanel();
        jPanel7 = new javax.swing.JPanel();
        jScrollPane6 = new javax.swing.JScrollPane();
        jtb_almacensurtirexterno = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                if (mColIndex < 2)
                return false;
                else
                return true;

            }
        }
        ;
        jbtn_guardarexterno = new javax.swing.JButton();
        jPanel8 = new javax.swing.JPanel();
        jScrollPane13 = new javax.swing.JScrollPane();
        jta_archivo = new javax.swing.JEditorPane();
        jLabel1 = new javax.swing.JLabel();
        jbtn_importarfile = new javax.swing.JButton();
        jcbx_clientesorigen = new javax.swing.JComboBox();
        jLabel4 = new javax.swing.JLabel();
        jcbx_clientesdestino = new javax.swing.JComboBox();
        jLabel5 = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jmni_salir = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jmni_escape = new javax.swing.JMenuItem();
        jmni_guardar = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(sie_invdis.Sie_invdisApp.class).getContext().getResourceMap(com_distri_articulos_almacen_resurtir.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setName("Form"); // NOI18N

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel5.border.title"))); // NOI18N
        jPanel5.setName("jPanel5"); // NOI18N

        jScrollPane3.setName("jScrollPane3"); // NOI18N

        jtb_almacen_familias.setModel(this.jtable_modelo_familiarexistencia);
        jtb_almacen_familias.setName("jtb_almacen_familias"); // NOI18N
        jtb_almacen_familias.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jtb_almacen_familiasMouseClicked(evt);
                if(evt.getClickCount() >= 2)
                {
                    dioclickfamilia(evt);
                    //System.out.println(" double click" );

                }
            }
        });
        jScrollPane3.setViewportView(jtb_almacen_familias);

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 384, Short.MAX_VALUE)
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 114, Short.MAX_VALUE)
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel2.border.title"))); // NOI18N
        jPanel2.setName("jPanel2"); // NOI18N

        buttonGroup1.add(jrb_bclave);
        jrb_bclave.setText(resourceMap.getString("jrb_bclave.text")); // NOI18N
        jrb_bclave.setToolTipText(resourceMap.getString("jrb_bclave.toolTipText")); // NOI18N
        jrb_bclave.setActionCommand(resourceMap.getString("jrb_bclave.actionCommand")); // NOI18N
        jrb_bclave.setName("jrb_bclave"); // NOI18N
        jrb_bclave.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_bclaveActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrb_bdescrip);
        jrb_bdescrip.setText(resourceMap.getString("jrb_bdescrip.text")); // NOI18N
        jrb_bdescrip.setToolTipText(resourceMap.getString("jrb_bdescrip.toolTipText")); // NOI18N
        jrb_bdescrip.setActionCommand(resourceMap.getString("jrb_bdescrip.actionCommand")); // NOI18N
        jrb_bdescrip.setName("jrb_bdescrip"); // NOI18N
        jrb_bdescrip.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_bdescripActionPerformed(evt);
            }
        });

        jtf_busqueda.setToolTipText(resourceMap.getString("jtf_busqueda.toolTipText")); // NOI18N
        jtf_busqueda.setName("jtf_busqueda"); // NOI18N
        jtf_busqueda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_busquedaActionPerformed(evt);
            }
        });

        jbtn_buscar.setText(resourceMap.getString("jbtn_buscar.text")); // NOI18N
        jbtn_buscar.setName("jbtn_buscar"); // NOI18N
        jbtn_buscar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_buscarActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrb_bitem);
        jrb_bitem.setText(resourceMap.getString("jrb_bitem.text")); // NOI18N
        jrb_bitem.setToolTipText(resourceMap.getString("jrb_bitem.toolTipText")); // NOI18N
        jrb_bitem.setActionCommand(resourceMap.getString("jrb_bitem.actionCommand")); // NOI18N
        jrb_bitem.setName("jrb_bitem"); // NOI18N
        jrb_bitem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_bitemActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrb_bprecio);
        jrb_bprecio.setText(resourceMap.getString("jrb_bprecio.text")); // NOI18N
        jrb_bprecio.setToolTipText(resourceMap.getString("jrb_bprecio.toolTipText")); // NOI18N
        jrb_bprecio.setActionCommand(resourceMap.getString("jrb_bprecio.actionCommand")); // NOI18N
        jrb_bprecio.setName("jrb_bprecio"); // NOI18N
        jrb_bprecio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_bprecioActionPerformed(evt);
            }
        });

        buttonGroup2.add(jrb_obexacto);
        jrb_obexacto.setText(resourceMap.getString("jrb_obexacto.text")); // NOI18N
        jrb_obexacto.setToolTipText(resourceMap.getString("jrb_obexacto.toolTipText")); // NOI18N
        jrb_obexacto.setActionCommand(resourceMap.getString("jrb_obexacto.actionCommand")); // NOI18N
        jrb_obexacto.setName("jrb_obexacto"); // NOI18N
        jrb_obexacto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_obexactoActionPerformed(evt);
            }
        });

        buttonGroup2.add(jrb_obcomienza);
        jrb_obcomienza.setText(resourceMap.getString("jrb_obcomienza.text")); // NOI18N
        jrb_obcomienza.setToolTipText(resourceMap.getString("jrb_obcomienza.toolTipText")); // NOI18N
        jrb_obcomienza.setActionCommand(resourceMap.getString("jrb_obcomienza.actionCommand")); // NOI18N
        jrb_obcomienza.setName("jrb_obcomienza"); // NOI18N
        jrb_obcomienza.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_obcomienzaActionPerformed(evt);
            }
        });

        buttonGroup2.add(jrb_obaniway);
        jrb_obaniway.setText(resourceMap.getString("jrb_obaniway.text")); // NOI18N
        jrb_obaniway.setToolTipText(resourceMap.getString("jrb_obaniway.toolTipText")); // NOI18N
        jrb_obaniway.setActionCommand(resourceMap.getString("jrb_obaniway.actionCommand")); // NOI18N
        jrb_obaniway.setName("jrb_obaniway"); // NOI18N
        jrb_obaniway.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_obaniwayActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrb_bidfam);
        jrb_bidfam.setText(resourceMap.getString("jrb_bidfam.text")); // NOI18N
        jrb_bidfam.setToolTipText(resourceMap.getString("jrb_bidfam.toolTipText")); // NOI18N
        jrb_bidfam.setActionCommand(resourceMap.getString("jrb_bidfam.actionCommand")); // NOI18N
        jrb_bidfam.setName("jrb_bidfam"); // NOI18N
        jrb_bidfam.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_bidfamActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrb_bidsubfam);
        jrb_bidsubfam.setText(resourceMap.getString("jrb_bidsubfam.text")); // NOI18N
        jrb_bidsubfam.setToolTipText(resourceMap.getString("jrb_bidsubfam.toolTipText")); // NOI18N
        jrb_bidsubfam.setActionCommand(resourceMap.getString("jrb_bidsubfam.actionCommand")); // NOI18N
        jrb_bidsubfam.setName("jrb_bidsubfam"); // NOI18N
        jrb_bidsubfam.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_bidsubfamActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrb_bdessubfam);
        jrb_bdessubfam.setText(resourceMap.getString("jrb_bdessubfam.text")); // NOI18N
        jrb_bdessubfam.setToolTipText(resourceMap.getString("jrb_bdessubfam.toolTipText")); // NOI18N
        jrb_bdessubfam.setActionCommand(resourceMap.getString("jrb_bdessubfam.actionCommand")); // NOI18N
        jrb_bdessubfam.setName("jrb_bdessubfam"); // NOI18N
        jrb_bdessubfam.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_bdessubfamActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrb_descripcorta);
        jrb_descripcorta.setText(resourceMap.getString("jrb_descripcorta.text")); // NOI18N
        jrb_descripcorta.setToolTipText(resourceMap.getString("jrb_descripcorta.toolTipText")); // NOI18N
        jrb_descripcorta.setActionCommand(resourceMap.getString("jrb_descripcorta.actionCommand")); // NOI18N
        jrb_descripcorta.setName("jrb_descripcorta"); // NOI18N
        jrb_descripcorta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_descripcortaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jrb_bclave)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jrb_bdescrip)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jrb_bitem)
                        .addGap(4, 4, 4)
                        .addComponent(jrb_bprecio)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jrb_bidfam)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jrb_bidsubfam)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jrb_bdessubfam)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jrb_descripcorta))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jrb_obexacto)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jrb_obcomienza)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jrb_obaniway)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jtf_busqueda, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jbtn_buscar)))
                .addContainerGap(54, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jrb_obcomienza)
                    .addComponent(jtf_busqueda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jrb_obaniway)
                    .addComponent(jrb_obexacto)
                    .addComponent(jbtn_buscar))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jrb_bclave)
                    .addComponent(jrb_bdescrip)
                    .addComponent(jrb_bprecio)
                    .addComponent(jrb_bitem)
                    .addComponent(jrb_bidfam)
                    .addComponent(jrb_bidsubfam)
                    .addComponent(jrb_bdessubfam)
                    .addComponent(jrb_descripcorta)))
        );

        jTabbedPane1.setName("jTabbedPane1"); // NOI18N
        jTabbedPane1.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jTabbedPane1StateChanged(evt);
            }
        });

        jPanel1.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        jPanel1.setName("jPanel1"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jtb_almacen_catalogo.setModel(this.jtable_modelo);
        jtb_almacen_catalogo.setName("jtb_almacen_catalogo"); // NOI18N
        jtb_almacen_catalogo.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jtb_almacen_catalogoMouseClicked(evt);
                if(evt.getClickCount() >= 1)
                {
                    dioclick(evt);
                }
                if(evt.getClickCount() >= 2)
                {
                    dioclickalmacen(evt);
                }
            }
        });
        jScrollPane1.setViewportView(jtb_almacen_catalogo);

        jScrollPane2.setName("jScrollPane2"); // NOI18N

        jep_imagen2.setContentType(resourceMap.getString("jep_imagen2.contentType")); // NOI18N
        jep_imagen2.setEditable(false);
        jep_imagen2.setName("jep_imagen2"); // NOI18N
        jScrollPane2.setViewportView(jep_imagen2);

        jtf_articulo.setEditable(false);
        jtf_articulo.setText(resourceMap.getString("jtf_articulo.text")); // NOI18N
        jtf_articulo.setName("jtf_articulo"); // NOI18N

        jdc_fechadocto.setToolTipText(resourceMap.getString("jdc_fechadocto.toolTipText")); // NOI18N
        jdc_fechadocto.setDateFormatString(resourceMap.getString("jdc_fechadocto.dateFormatString")); // NOI18N
        jdc_fechadocto.setEnabled(false);
        jdc_fechadocto.setMaxSelectableDate(new java.util.Date(253370790102000L));
        jdc_fechadocto.setName("jdc_fechadocto"); // NOI18N

        jchbx_veridinsumo1.setText(resourceMap.getString("jchbx_veridinsumo1.text")); // NOI18N
        jchbx_veridinsumo1.setName("jchbx_veridinsumo1"); // NOI18N
        jchbx_veridinsumo1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jchbx_veridinsumo1ActionPerformed(evt);
            }
        });

        jchbx_veridinsumo.setText(resourceMap.getString("jchbx_veridinsumo.text")); // NOI18N
        jchbx_veridinsumo.setName("jchbx_veridinsumo"); // NOI18N
        jchbx_veridinsumo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jchbx_veridinsumoActionPerformed(evt);
            }
        });

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel3.border.title"))); // NOI18N
        jPanel3.setName("jPanel3"); // NOI18N

        jScrollPane4.setName("jScrollPane4"); // NOI18N

        jtb_almacensurtir.setModel(this.jtable_modelo_almacen);
        jtb_almacensurtir.setName("jtb_almacensurtir"); // NOI18N
        jScrollPane4.setViewportView(jtb_almacensurtir);

        jbtn_guardar.setIcon(resourceMap.getIcon("jbtn_guardar.icon")); // NOI18N
        jbtn_guardar.setText(resourceMap.getString("jbtn_guardar.text")); // NOI18N
        jbtn_guardar.setName("jbtn_guardar"); // NOI18N
        jbtn_guardar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_guardarActionPerformed(evt);
            }
        });

        jtf_observaciones.setText(resourceMap.getString("jtf_observaciones.text")); // NOI18N
        jtf_observaciones.setName("jtf_observaciones"); // NOI18N

        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(jLabel3)
                .addGap(2, 2, 2)
                .addComponent(jtf_observaciones, javax.swing.GroupLayout.DEFAULT_SIZE, 308, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addComponent(jbtn_guardar)
                .addGap(64, 64, 64))
            .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 544, Short.MAX_VALUE)
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 105, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jtf_observaciones, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbtn_guardar)))
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 274, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jchbx_veridinsumo, javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jchbx_veridinsumo1, javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jdc_fechadocto, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 135, Short.MAX_VALUE)
                    .addComponent(jtf_articulo, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1001, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE)
                    .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(15, 15, 15)
                        .addComponent(jtf_articulo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jdc_fechadocto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 32, Short.MAX_VALUE)
                        .addComponent(jchbx_veridinsumo1)
                        .addGap(15, 15, 15)
                        .addComponent(jchbx_veridinsumo))))
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel1.TabConstraints.tabTitle"), jPanel1); // NOI18N

        jPanel4.setName("jPanel4"); // NOI18N

        jScrollPane5.setName("jScrollPane5"); // NOI18N

        jepn_fotos.setContentType(resourceMap.getString("jepn_fotos.contentType")); // NOI18N
        jepn_fotos.setName("jepn_fotos"); // NOI18N
        jScrollPane5.setViewportView(jepn_fotos);

        jlbl_paginas.setText(resourceMap.getString("jlbl_paginas.text")); // NOI18N
        jlbl_paginas.setName("jlbl_paginas"); // NOI18N

        jbtn_anterior.setIcon(resourceMap.getIcon("jbtn_anterior.icon")); // NOI18N
        jbtn_anterior.setText(resourceMap.getString("jbtn_anterior.text")); // NOI18N
        jbtn_anterior.setName("jbtn_anterior"); // NOI18N
        jbtn_anterior.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_anteriorActionPerformed(evt);
            }
        });

        jtf_paginaactual.setText(resourceMap.getString("jtf_paginaactual.text")); // NOI18N
        jtf_paginaactual.setToolTipText(resourceMap.getString("jtf_paginaactual.toolTipText")); // NOI18N
        jtf_paginaactual.setName("jtf_paginaactual"); // NOI18N
        jtf_paginaactual.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_paginaactualActionPerformed(evt);
            }
        });

        jbtn_siguiente.setIcon(resourceMap.getIcon("jbtn_siguiente.icon")); // NOI18N
        jbtn_siguiente.setText(resourceMap.getString("jbtn_siguiente.text")); // NOI18N
        jbtn_siguiente.setName("jbtn_siguiente"); // NOI18N
        jbtn_siguiente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_siguienteActionPerformed(evt);
            }
        });

        jtf_fotosartxpag.setText(resourceMap.getString("jtf_fotosartxpag.text")); // NOI18N
        jtf_fotosartxpag.setToolTipText(resourceMap.getString("jtf_fotosartxpag.toolTipText")); // NOI18N
        jtf_fotosartxpag.setName("jtf_fotosartxpag"); // NOI18N
        jtf_fotosartxpag.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_fotosartxpagActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jtf_fotosartxpag, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 288, Short.MAX_VALUE)
                .addComponent(jlbl_paginas)
                .addGap(27, 27, 27)
                .addComponent(jbtn_anterior)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jtf_paginaactual, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jbtn_siguiente)
                .addGap(344, 344, 344))
            .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 1003, Short.MAX_VALUE)
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jlbl_paginas)
                    .addComponent(jbtn_anterior)
                    .addComponent(jbtn_siguiente)
                    .addComponent(jtf_paginaactual, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtf_fotosartxpag, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 410, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel4.TabConstraints.tabTitle"), jPanel4); // NOI18N

        jPanel6.setName("jPanel6"); // NOI18N

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel7.border.title"))); // NOI18N
        jPanel7.setName("jPanel7"); // NOI18N

        jScrollPane6.setName("jScrollPane6"); // NOI18N

        jtb_almacensurtirexterno.setModel(this.jtable_modelo_almacen);
        jtb_almacensurtirexterno.setName("jtb_almacensurtirexterno"); // NOI18N
        jScrollPane6.setViewportView(jtb_almacensurtirexterno);

        jbtn_guardarexterno.setIcon(resourceMap.getIcon("jbtn_guardarexterno.icon")); // NOI18N
        jbtn_guardarexterno.setText(resourceMap.getString("jbtn_guardarexterno.text")); // NOI18N
        jbtn_guardarexterno.setName("jbtn_guardarexterno"); // NOI18N
        jbtn_guardarexterno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_guardarexternoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                .addContainerGap(377, Short.MAX_VALUE)
                .addComponent(jbtn_guardarexterno)
                .addGap(64, 64, 64))
            .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 550, Short.MAX_VALUE)
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jbtn_guardarexterno))
        );

        jPanel8.setName("jPanel8"); // NOI18N

        jScrollPane13.setName("jScrollPane13"); // NOI18N

        jta_archivo.setName("jta_archivo"); // NOI18N
        jScrollPane13.setViewportView(jta_archivo);

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        jbtn_importarfile.setIcon(resourceMap.getIcon("jbtn_importarfile.icon")); // NOI18N
        jbtn_importarfile.setText(resourceMap.getString("jbtn_importarfile.text")); // NOI18N
        jbtn_importarfile.setName("jbtn_importarfile"); // NOI18N
        jbtn_importarfile.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_importarfileActionPerformed(evt);
            }
        });

        jcbx_clientesorigen.setToolTipText(resourceMap.getString("jcbx_clientesorigen.toolTipText")); // NOI18N
        jcbx_clientesorigen.setName("jcbx_clientesorigen"); // NOI18N
        jcbx_clientesorigen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcbx_clientesorigenActionPerformed(evt);
            }
        });

        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
        jLabel4.setName("jLabel4"); // NOI18N

        jcbx_clientesdestino.setToolTipText(resourceMap.getString("jcbx_clientesdestino.toolTipText")); // NOI18N
        jcbx_clientesdestino.setName("jcbx_clientesdestino"); // NOI18N
        jcbx_clientesdestino.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcbx_clientesdestinoActionPerformed(evt);
            }
        });

        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 294, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addGroup(jPanel8Layout.createSequentialGroup()
                            .addComponent(jScrollPane13)
                            .addGap(17, 17, 17)
                            .addComponent(jbtn_importarfile))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel8Layout.createSequentialGroup()
                            .addComponent(jLabel4)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jcbx_clientesorigen, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jLabel5)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jcbx_clientesdestino, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(162, Short.MAX_VALUE))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jcbx_clientesorigen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5)
                    .addComponent(jcbx_clientesdestino, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane13, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jbtn_importarfile))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(415, Short.MAX_VALUE))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel6.TabConstraints.tabTitle"), jPanel6); // NOI18N

        jMenuBar1.setName("jMenuBar1"); // NOI18N

        jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N
        jMenu1.setName("jMenu1"); // NOI18N

        jmni_salir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.ALT_MASK));
        jmni_salir.setIcon(resourceMap.getIcon("jmni_salir.icon")); // NOI18N
        jmni_salir.setText(resourceMap.getString("jmni_salir.text")); // NOI18N
        jmni_salir.setName("jmni_salir"); // NOI18N
        jmni_salir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_salirActionPerformed(evt);
            }
        });
        jMenu1.add(jmni_salir);

        jMenuBar1.add(jMenu1);

        jMenu2.setText(resourceMap.getString("jMenu2.text")); // NOI18N
        jMenu2.setName("jMenu2"); // NOI18N

        jmni_escape.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0));
        jmni_escape.setText(resourceMap.getString("jmni_escape.text")); // NOI18N
        jmni_escape.setName("jmni_escape"); // NOI18N
        jmni_escape.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_escapeActionPerformed(evt);
            }
        });
        jMenu2.add(jmni_escape);

        jmni_guardar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F7, 0));
        jmni_guardar.setText(resourceMap.getString("jmni_guardar.text")); // NOI18N
        jmni_guardar.setName("jmni_guardar"); // NOI18N
        jmni_guardar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_guardarActionPerformed(evt);
            }
        });
        jMenu2.add(jmni_guardar);

        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jTabbedPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 1008, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 492, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jmni_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_salirActionPerformed
        // TODO add your handling code here:
       if(JOptionPane.showConfirmDialog(null, "Desea Salir?")==0)
                {
                    this.dispose();
                }
    }//GEN-LAST:event_jmni_salirActionPerformed

    private void jrb_bclaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_bclaveActionPerformed
        // TODO add your handling code here:

        buscamp=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrb_bclaveActionPerformed

    private void jrb_bdescripActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_bdescripActionPerformed
        // TODO add your handling code here:
        buscamp=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrb_bdescripActionPerformed

    private void jtf_busquedaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_busquedaActionPerformed
        // TODO add your handling code here:
        this.jbtn_buscarActionPerformed(evt);
}//GEN-LAST:event_jtf_busquedaActionPerformed

    private void jbtn_buscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_buscarActionPerformed
        // TODO add your handling code here:
        // this.jtf_busqueda.getText();
                if(JOptionPane.showConfirmDialog(null, "Estan Correctos sus Datos?")==0)
                    {
                        this.carga_datos_catalogoarticulos_almacen(buscamp,opbuscamp,this.jtf_busqueda.getText().toUpperCase().trim());
                    }
                else
                    {
                        this.jtf_busqueda.requestFocus();
                    }
    }//GEN-LAST:event_jbtn_buscarActionPerformed

    private void jrb_bitemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_bitemActionPerformed
        // TODO add your handling code here:
        buscamp=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrb_bitemActionPerformed

    private void jrb_bprecioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_bprecioActionPerformed
        // TODO add your handling code here:
        buscamp=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrb_bprecioActionPerformed

    private void jrb_obexactoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_obexactoActionPerformed
        // TODO add your handling code here:
        opbuscamp=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrb_obexactoActionPerformed

    private void jrb_obcomienzaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_obcomienzaActionPerformed
        // TODO add your handling code here:
        opbuscamp=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrb_obcomienzaActionPerformed

    private void jrb_obaniwayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_obaniwayActionPerformed
        // TODO add your handling code here:
        opbuscamp=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrb_obaniwayActionPerformed

    private void jrb_bidfamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_bidfamActionPerformed
        // TODO add your handling code here:
        buscamp=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrb_bidfamActionPerformed

    private void jrb_bidsubfamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_bidsubfamActionPerformed
        // TODO add your handling code here:
        buscamp=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrb_bidsubfamActionPerformed

    private void jrb_bdessubfamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_bdessubfamActionPerformed
        // TODO add your handling code here:
        buscamp=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrb_bdessubfamActionPerformed

    private void jmni_escapeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_escapeActionPerformed
        // TODO add your handling code here:
        this.jmni_salirActionPerformed(evt);
    }//GEN-LAST:event_jmni_escapeActionPerformed
private void jtb_almacen_catalogoMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
}      
    private void jchbx_veridinsumoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jchbx_veridinsumoActionPerformed
        // TODO add your handling code here:
         try
             {
               rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_codigo_buscasidsieuno('"+this.jtf_articulo.getText()+"') as (idarticulo integer);",variables_global.getconexiongral());
                while (rs.next())
                        {
                            articulos_sie_editar fase=new articulos_sie_editar(rs.getString(1));
                            fase.pack();
                            fase.setVisible(true);
                        }
                }
                catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                    }
}//GEN-LAST:event_jchbx_veridinsumoActionPerformed

    private void jbtn_guardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_guardarActionPerformed
        // TODO add your handling code here:
    int numerofilas=this.jtable_modelo_almacen.getRowCount();
    if(numerofilas>0)
        {
            this.guarda_requisision();
        }
    else
        {
            JOptionPane.showMessageDialog(null,"No Existen Registros", "Sistema Integral(Requisicion Almacen) : Error",1);
        }
        //this.imprimir(0, 0);

}//GEN-LAST:event_jbtn_guardarActionPerformed

    private void jchbx_veridinsumo1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jchbx_veridinsumo1ActionPerformed
        // TODO add your handling code here:
        com_distri_articulos_almacen_detalle fcdaad=new com_distri_articulos_almacen_detalle(1,this.jtf_articulo.getText());
         fcdaad.pack();
         fcdaad.setVisible(true);
    }//GEN-LAST:event_jchbx_veridinsumo1ActionPerformed

    private void jrb_descripcortaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_descripcortaActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jrb_descripcortaActionPerformed

    private void jmni_guardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_guardarActionPerformed
        // TODO add your handling code here:
        this.jbtn_guardarActionPerformed(evt);
    }//GEN-LAST:event_jmni_guardarActionPerformed

    private void jTabbedPane1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabbedPane1StateChanged
        // TODO add your handling code here:
        indexactual=this.jTabbedPane1.getSelectedIndex();
           if(indexactual==1)
            {
               this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));
            }
    }//GEN-LAST:event_jTabbedPane1StateChanged

    private void jbtn_anteriorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_anteriorActionPerformed
        // TODO add your handling code here:
        this.jtf_paginaactual.setText(String.valueOf(Integer.valueOf(this.jtf_paginaactual.getText().toString())-1));
        System.out.println("Esta es la pagina que mando"+this.jtf_paginaactual.getText());
        this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));
    }//GEN-LAST:event_jbtn_anteriorActionPerformed

    private void jbtn_siguienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_siguienteActionPerformed
        // TODO add your handling code here:
        this.jtf_paginaactual.setText(String.valueOf(Integer.valueOf(this.jtf_paginaactual.getText().toString())+1));
        System.out.println("Esta es la pagina que mando"+this.jtf_paginaactual.getText());
        this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));

    }//GEN-LAST:event_jbtn_siguienteActionPerformed

    private void jbtn_guardarexternoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_guardarexternoActionPerformed
        // TODO add your handling code here:
        this.jbtn_guardarActionPerformed(evt);
}//GEN-LAST:event_jbtn_guardarexternoActionPerformed

    private void jbtn_importarfileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_importarfileActionPerformed
        // TODO add your handling code here:
        String arreglo_idcliori[]=this.jcbx_clientesorigen.getSelectedItem().toString().split(":");
        String arreglo_idclide[]=this.jcbx_clientesdestino.getSelectedItem().toString().split(":");
        int indio=this.jcbx_clientesorigen.getSelectedIndex(),indid=this.jcbx_clientesdestino.getSelectedIndex();

        String arreglo_importa[]=this.jta_archivo.getText().split("\n");
        String arreglo_codigo[]=null;
        System.out.println("Estos tiene archivo:"+arreglo_importa.length);
        if((indio>0)&& (indid>0))
            {
            if(JOptionPane.showConfirmDialog(null,"<html>Estan estan Correcto sus Datos:?<h2><br>Origen:"+this.jcbx_clientesorigen.getSelectedItem()+"<br>Destino:"+this.jcbx_clientesdestino.getSelectedItem()+"</h2></html>")==0)
                {
                    for (int i=0;i<arreglo_importa.length;i++)
                        {
                            arreglo_codigo=arreglo_importa[i].split("\t");
                            jtable_modelo_almacen.addRow(new Object[]{arreglo_idclide[0],arreglo_idcliori[0],arreglo_codigo[0].toUpperCase().trim(),"Importado",arreglo_codigo[1],"."});
                        }
                    this.jta_archivo.setText("");
                }
            }
        else
            {
                JOptionPane.showMessageDialog(null,"Verifique Origen y Destino de Salida", "Sistema Integral(Resurtido) : Error",1);
            }
}//GEN-LAST:event_jbtn_importarfileActionPerformed

    private void jtf_paginaactualActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_paginaactualActionPerformed
        // TODO add your handling code here:
         this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));
    }//GEN-LAST:event_jtf_paginaactualActionPerformed

    private void jtf_fotosartxpagActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_fotosartxpagActionPerformed
        // TODO add your handling code here:
         this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));
    }//GEN-LAST:event_jtf_fotosartxpagActionPerformed

    private void jcbx_clientesorigenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbx_clientesorigenActionPerformed
        // TODO add your handling code here:

       

        //this.jtfpruebados.setText(jtable_tiendas.getValueAt(indeceta, 0).toString());
}//GEN-LAST:event_jcbx_clientesorigenActionPerformed

    private void jcbx_clientesdestinoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbx_clientesdestinoActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jcbx_clientesdestinoActionPerformed
private void dioclick(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
            
            int fila = jtb_almacen_catalogo.getSelectedRow();
            String fotoar=this.jtable_modelo.getValueAt(fila, 0).toString().replace("<html><BODY bgcolor=#CC0066>", "").replace("</BODY></html>","");
            this.jtf_articulo.setText(fotoar);

            String textofoto="<html><head></head><body><img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+fotoar+".JPG\" width=\"240\" height=\"155\" border=\"0\" alt=\"Foto Articulo\"></img></body></html>";
            System.out.println("foto:"+textofoto);
            this.jep_imagen2.setText(textofoto);
    }

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new com_distri_articulos_almacen_resurtir().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane13;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JButton jbtn_anterior;
    private javax.swing.JButton jbtn_buscar;
    private javax.swing.JButton jbtn_guardar;
    private javax.swing.JButton jbtn_guardarexterno;
    private javax.swing.JButton jbtn_importarfile;
    private javax.swing.JButton jbtn_siguiente;
    private javax.swing.JComboBox jcbx_clientesdestino;
    private javax.swing.JComboBox jcbx_clientesorigen;
    private javax.swing.JCheckBox jchbx_veridinsumo;
    private javax.swing.JCheckBox jchbx_veridinsumo1;
    private com.toedter.calendar.JDateChooser jdc_fechadocto;
    private javax.swing.JEditorPane jep_imagen2;
    private javax.swing.JEditorPane jepn_fotos;
    private javax.swing.JLabel jlbl_paginas;
    private javax.swing.JMenuItem jmni_escape;
    private javax.swing.JMenuItem jmni_guardar;
    private javax.swing.JMenuItem jmni_salir;
    private javax.swing.JRadioButton jrb_bclave;
    private javax.swing.JRadioButton jrb_bdescrip;
    private javax.swing.JRadioButton jrb_bdessubfam;
    private javax.swing.JRadioButton jrb_bidfam;
    private javax.swing.JRadioButton jrb_bidsubfam;
    private javax.swing.JRadioButton jrb_bitem;
    private javax.swing.JRadioButton jrb_bprecio;
    private javax.swing.JRadioButton jrb_descripcorta;
    private javax.swing.JRadioButton jrb_obaniway;
    private javax.swing.JRadioButton jrb_obcomienza;
    private javax.swing.JRadioButton jrb_obexacto;
    private javax.swing.JEditorPane jta_archivo;
    private javax.swing.JTable jtb_almacen_catalogo;
    private javax.swing.JTable jtb_almacen_familias;
    private javax.swing.JTable jtb_almacensurtir;
    private javax.swing.JTable jtb_almacensurtirexterno;
    private javax.swing.JTextField jtf_articulo;
    private javax.swing.JTextField jtf_busqueda;
    private javax.swing.JTextField jtf_fotosartxpag;
    private javax.swing.JTextField jtf_observaciones;
    private javax.swing.JTextField jtf_paginaactual;
    // End of variables declaration//GEN-END:variables
    private com_distri_folios_imprimir objimpresora;
}
